from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains


#鼠标操作
driver = webdriver.Firefox()
driver.get("https://www.baidu.com")

# 右键
serach = driver.find_element(by=By.XPATH,value='//*[@id="kw"]')
#右键
# ActionChains(driver).context_click(serach).perform()

# 双击左键
ActionChains(driver).double_click(serach).perform()

# 鼠标悬停
# 设置
settings = driver.find_element(by=By.XPATH,value='//*[@id="s-usersetting-top"]')
ActionChains(driver).move_to_element(settings).perform()